﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CPPEI.ETL.Domain.SysService;

namespace CPPEI.ETL.Domain.WcfServices
{
    public class ServiceExtendService
    {
        public SysUserInfo GetUserByOnline(string userId)
        {
            try
            {
                IServiceExtend serviceExtend = new ServiceExtendClient();
                var result = serviceExtend.GetSYSUserByUserID(ConfigurationManager.AppSettings["SiteID"], userId);
                if (result == null)
                    return null;
                else
                {
                    return new SysUserInfo()
                    {
                        UserName = result.UserName,
                        UserId = result.UserID,
                        Pwd = result.PWD
                    };
                }
            }
            catch (Exception)
            {
                throw;
            }

        }
        public class SysUserInfo
        {
            public string UserName { get; set; }
            public string Pwd { get; set; }
            public string UserId { get; set; }
        }
    }
}
